{% extends "base.html" %}

{% block content %}
		<table border=1>
		<tr>
			<td width='40%' rowspan='3'>
				<div class="room_image">
				{% if room.get_image %}
					<img src="images/{{room.get_image}}" class="room_image"/>
				{% endif %}
				</div>
			</td>
			<td colspan='2' valign='top'>
				{% if cutscene %}
				<div class="cutscene">
					<p>Situation: {{cutscene}}</p>
				</div>
				{% endif %}
				
				<div class="room_description">
					<p>{{room.get_description}}</p>
				</div>
			</td>
		<tr>
			<td width=30%>
				<div class="room_inventory">
					{% if room.inventory %}
					<p>You see some stuff in this room:</p>
					<form action="{{this_page}}" method="post">
					{% for item in room.inventory.values %}
					<div><input type="checkbox" name="room_inventory" value="{{item.get_id}}"/>&nbsp<img class="icon" src="images/{{item.get_image}}"/>&nbsp&nbsp{{item.get_description}}</div>
					{% endfor %}
					<div><input type="submit" name="inventory" value="Take item(s)"/></div>
					</form>
					{% else %}
					<p>You don't see anything interesting lying around.</p>
					{% endif %}
					</div>
			</td>
			<td>	
					<div class="player_inventory">
					<p>Your inventory:</p>
					{% if player.inventory %}
					<form action="{{this_page}}" method="post">
					{% for item in player.inventory.values %}
					<div><input type="checkbox" name="player_inventory" value="{{item.get_id}}"/>&nbsp<img class="icon" src="images/{{item.get_image}}"/>&nbsp&nbsp{{item.get_description}}</div>
					{% endfor %}
					<div><input type="submit" name="inventory" value="Drop item(s)"/></div>
					</form>
					{% else %}
					<p>You are not carrying anything.</p>
					{% endif %}
					</div>
			</td>
		</tr>
		<tr>
		
		<td colspan='2'>
		<div class="actions">
		<p>Navigation:</p>
		{% for action in menu.actions.values %}
		
		{% if action.isItemAction %}
		{% else %}
		<div class="action_form">
		<form action="{{this_page}}" method="{{action.get_method}}">
		      <input type="hidden" name="action_name" value="{{action.get_id}}" />
		      <input type="submit" name="action" value="{{action.get_description}}"/>
		</form>
		</div>
		{% endif %}
		{% endfor %}
		</div>
		
		<div class="actions">
		<p>Actions:</p>
		{% for action in menu.actions.values %}
		
			{% if action.isItemAction %}
				<div class="action_form">
				<form action="{{this_page}}" method="{{action.get_method}}">
				      <input type="hidden" name="action_name" value="{{action.get_id}}" />
				      <input type="submit" name="action" value="{{action.get_description}}"/>
				</form>
				</div>
			{% endif %}
		{% endfor %}
		</div>
		
		</td>
		</tr>
		</table>
{% endblock content %}
